package cate.common.table.guild.guildboss;

import cate.common.table.ESheet;
import cate.common.util.random.RWList;

public class GuildBossRewardSheet extends ESheet<GuildBossRewardRow> {
    @Override
    public String getSheetName() {
        return "掉落奖励";
    }

    /**
     * 根据分组随机奖励
     */
    public GuildBossRewardRow random(int prizeId) {
        GuildBossRewardRow res = null;
        RWList<GuildBossRewardRow> list = new RWList<>();
        for (GuildBossRewardRow row : getList()) {
            if (row.group == prizeId) {
                list.add(row);
            }
        }
        if (list.isNotEmpty()) {
            list.setup();
            res = list.get();
        }
        return res;
    }
}